package com.localjoycommunity.cpdj.project.system.service.impl;

import java.util.List;
import com.localjoycommunity.cpdj.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.localjoycommunity.cpdj.project.system.mapper.LeagueBranchMapper;
import com.localjoycommunity.cpdj.project.system.domain.LeagueBranch;
import com.localjoycommunity.cpdj.project.system.service.ILeagueBranchService;

/**
 * 团支部Service业务层处理
 *
 * @author aqie
 * @date 2020-11-04
 */
@Service
public class LeagueBranchServiceImpl implements ILeagueBranchService
{
    @Autowired
    private LeagueBranchMapper leagueBranchMapper;

    /**
     * 查询团支部
     *
     * @param id 团支部ID
     * @return 团支部
     */
    @Override
    public LeagueBranch selectLeagueBranchById(Long id)
    {
        return leagueBranchMapper.selectLeagueBranchById(id);
    }

    /**
     * 查询团支部列表
     *
     * @param leagueBranch 团支部
     * @return 团支部
     */
    @Override
    public List<LeagueBranch> selectLeagueBranchList(LeagueBranch leagueBranch)
    {
        return leagueBranchMapper.selectLeagueBranchList(leagueBranch);
    }

    /**
     * 新增团支部
     *
     * @param leagueBranch 团支部
     * @return 结果
     */
    @Override
    public int insertLeagueBranch(LeagueBranch leagueBranch)
    {
        leagueBranch.setCreateTime(DateUtils.getNowDate());
        return leagueBranchMapper.insertLeagueBranch(leagueBranch);
    }

    /**
     * 修改团支部
     *
     * @param leagueBranch 团支部
     * @return 结果
     */
    @Override
    public int updateLeagueBranch(LeagueBranch leagueBranch)
    {
        return leagueBranchMapper.updateLeagueBranch(leagueBranch);
    }

    /**
     * 批量删除团支部
     *
     * @param ids 需要删除的团支部ID
     * @return 结果
     */
    @Override
    public int deleteLeagueBranchByIds(Long[] ids)
    {
        return leagueBranchMapper.deleteLeagueBranchByIds(ids);
    }

    /**
     * 删除团支部信息
     *
     * @param id 团支部ID
     * @return 结果
     */
    @Override
    public int deleteLeagueBranchById(Long id)
    {
        return leagueBranchMapper.deleteLeagueBranchById(id);
    }
}
